package com.example.flow.enums;

/**
 * 流程结束标识
 * @author safe
 * @date 2021/1/30
 */
public enum EnumFinishFlag {
    NO("1", "未结束"),
    YES("0", "已结束");

    /** 码值 */
    private String code;

    /** 描述 */
    private String desc;

    EnumFinishFlag(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static EnumFinishFlag find(String code) {
        if (code == null) {
            return null;
        }
        for (EnumFinishFlag e : EnumFinishFlag.values()) {
            if (e.code.equals(code)) {
                return e;
            }
        }
        return null;
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }
}
